/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package LogicadeNegocio;


import CapadeDatos.daoper;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JComboBox;
import javax.swing.JTextField;

import modelo.beanper;

/**
 *
 * @author jxtx
 */
public class comboper {
JComboBox jcombo;
    ArrayList lista;
    beanper[] detalles;
    JTextField textbox;
public comboper(JComboBox combo){
        jcombo = combo;
    }

    public void cargarper() throws Exception{
     // Llamamos al metodo datos modulo que nos devuelve el ArrayList
      lista = (ArrayList) daoper.listaItem1();
      detalles = new beanper[lista.size()];
      Iterator itr = lista.iterator();
      int j=0;
      jcombo.removeAllItems();
      while (itr.hasNext()) {
          detalles[j] =  (beanper) itr.next();
          jcombo.addItem(detalles[j].getCod());
          j++;
      }

    }
    public  beanper[] semestre(){
      return detalles;
    }
}
